﻿Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Security

Partial Class main
    Inherits System.Web.UI.Page

    Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
        Dim success As String
        Dim vuser As New UserManagement

        success = vuser.VerifyUser(Me.txtUName.Text, Me.txtPassword.Text)

        Session("User") = txtUName.Text

        If success = True Then
            Response.Redirect("loggedin.aspx")
        Else
            Page.ClientScript.RegisterStartupScript(Me.GetType(), "alert_box", "alert('Invalid Username or Password');", True)
        End If
    End Sub
End Class
